<?php
/* @var $this DesaAnggotaController */
/* @var $model DesaAnggota */
/* @var $form CActiveForm */
global $pengurusdesa;
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'desa-anggota-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
    <table border="0" cellpadding="0" cellspacing="0" id="id-form">
        <tr>
            <th valign="top"><?php  echo $form->labelEx($model,'id_desa'); ?></th>
            <td class="idform">
                <?php  echo u::get_model_by_id('desa',$model->id_desa)->nama_desa ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('id_desa')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'id_desa', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php  echo $form->labelEx($model,'id_laskar'); ?></th>
            <td class="idform">
                <?php echo $form->hiddenField($model, 'id_laskar'); ?>
                <?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
                'name' => 'id_laskar_auto',
                'source' => url('kabupatenanggota/getlistjamaah'),
                'value'=> $model->idLaskar == null ? "" : $model->idLaskar->nama,//$model->ketua0->nama,
                'options' => array(
                    'showAnim' => 'fold',
                    'select' => 'js:function(event, ui){ jQuery("#' . CHtml::activeId($model, 'id_laskar') .
                        '").val(ui.item["id"]); }'),
                'htmlOptions' => array('size' => '60'))); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('id_laskar')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'id_laskar', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        <tr>
            <th valign="top"><?php echo $form->labelEx($model, 'jabatan'); ?></th>
            <td class="idform">
                <?php echo $form->dropDownList($model, 'jabatan', $pengurusdesa, array(
                'empty' => '(Pilih Jabatan)',
                'style' => 'width:200px')); ?>
            </td>
            <td class="idform">
                <?php if ($model->hasErrors('jabatan')) echo "<div class='error-left'></div>"; ?>
                <?php echo $form->error($model, 'jabatan', array('class' => 'error-inner')); ?>
            </td>
        </tr>
        
        <tr>
            <th>&nbsp;</th>
            <td valign="top">
                <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',
                array('class' => 'form-submit')); ?>
            </td>
            <td class="idform"></td>
        </tr>
    </table>
<?php $this->endWidget(); ?>

</div><!-- form -->